<?php

namespace App\Event;

use Symfony\Contracts\EventDispatcher\Event;

/**
 * 消息通知事件
 * Class NoticeEvent
 * @package App\Event
 */
class NoticeEvent extends Event {

    public const NAME = 'notice:event';
    protected $notice_type_id;
    protected $title;
    protected $content;
    protected $from_type;
    protected $from_id;
    protected $to_type;
    protected $to_id;
    protected $admin_user_id;

    public function __construct (array $data) {
        $this->notice_type_id = $data['notice_type_id'] ?? '';
        $this->title = $data['title'] ?? '';
        $this->content = $data['content'] ?? '';
        $this->from_type = $data['from_type'] ?? '';
        $this->from_id = $data['from_id'] ?? '';
        $this->to_type = $data['to_type'] ?? '';
        $this->to_id = $data['to_id'] ?? '';
        $this->admin_user_id = $data['admin_user_id'] ?? '';
    }

    public function getNoticeTypeId () {
        return $this->notice_type_id;
    }

    public function getTitle () {
        return $this->title;
    }

    public function getContent () {
        return $this->content;
    }

    public function getFromType () {
        return $this->from_type;
    }

    public function getFromId () {
        return $this->from_id;
    }

    public function getToType () {
        return $this->to_type;
    }

    public function getToId () {
        return $this->to_id;
    }

    public function getAdminUserId () {
        return $this->admin_user_id;
    }
}